package com.dao;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.StringUtils;


public class RewardSummary {
	
	private String previousBalance;
	private String pointsEarned;
	private String pointsRedeemed;
	private String totalNewBalance;
	private String expiryMonth;
	private String expiryPoints;

	public String getPreviousBalance() {
		return StringUtils.isBlank(previousBalance)? "0": previousBalance;
	}
	public void setPreviousBalance(String previousBalance) {
		this.previousBalance = previousBalance;
	}
	public String getPointsEarned() {
		return StringUtils.isBlank(pointsEarned)? "0": pointsEarned;
	}
	public void setPointsEarned(String pointsEarned) {
		this.pointsEarned = pointsEarned;
	}
	public String getPointsRedeemed() {
		return StringUtils.isBlank(pointsRedeemed)? "0": pointsRedeemed;
	}
	public void setPointsRedeemed(String pointsRedeemed) {
		this.pointsRedeemed = pointsRedeemed;
	}
	public String getTotalNewBalance() {
		return StringUtils.isBlank(totalNewBalance)? "0": totalNewBalance;
	}
	public void setTotalNewBalance(String totalNewBalance) {
		this.totalNewBalance = totalNewBalance;
	}
	public String getExpiryMonth() {
		return StringUtils.isBlank(expiryMonth)? "0": expiryMonth;
	}
	
	//Jan 2015
	public String getExpiryMonthDisplay() {
		String res = expiryMonth;
		if (expiryMonth != null) {
			try {
				Date date = new Date(expiryMonth);
				res = new SimpleDateFormat("MMM yyyy").format(date);
			} catch (Exception e) {}
		}
		return StringUtils.isBlank(res)? "0": res;
	}
	
	public void setExpiryMonth(String expiryMonth) {
		this.expiryMonth = expiryMonth;
	}
	public String getExpiryPoints() {
		return expiryPoints;
	}
	public void setExpiryPoints(String expiryPoints) {
		this.expiryPoints = expiryPoints;
	}	
}
